package com.xframe.domain.e3sp.bu.sale;

import com.xframe.domain.BaseModel;
import com.xframe.domain.e3sp.maindata.Province;
import com.xframe.domain.e3sp.maindata.domestic.Dealer;
import com.xframe.xdal.core.annotation.*;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

/**
 * com.xframe.domain.e3sp.bu.sale.BadStock
 * @author zjj
 * @create 2024/4/18 9:28
 */
@Data
@Accessors(chain=true)
@XTable(value = "bu_t01_badstock", label = "滞销库存表",dataSourceCode = "warehouse")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.maindata.domestic.Dealer", foreignKey = "dealerId", targetKey = "dealerId",as = "refDealer")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.maindata.Province",foreignKey = "provinceId", targetKey = "provinceId",as = "province")
public class BadStock extends BaseModel {

    /**
     * 滞销库存ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "badstock_id", primaryKeyFlag = true,desc = "滞销库存ID")
    private Long badstockId;

    /**
     * 备件清单ID
     */
    @XColumn(name = "spare_part_id", desc = "备件清单ID")
    private Long sparePartId;

    /**
     * 备件编码(自动带出)
     */
    @XQueryCondition
    @XColumn(name = "spare_part_no", desc = "备件编码")
    private String sparePartNo;

    /**
     * 备件名称(自动带出)
     */
    @XQueryCondition
    @XColumn(name = "spare_part_name", desc = "备件名称")
    private String sparePartName;

    /**
     * 备件英文名称(自动带出)
     */
    @XColumn(name = "spare_part_name_en", desc = "备件英文名称")
    private String sparePartNameEn;

    /**
     * 网点价(自动带出)
     */
    @XColumn(name = "dealer_price", desc = "网点价")
    private BigDecimal dealerPrice;

    /**
     * 销售价(界面输入)
     */
    @XColumn(name = "sale_price", desc = "销售价")
    private BigDecimal salePrice;

    /**
     * 经销商ID(当前登陆人单位ID)
     */
    @XColumn(name = "dealer_id", desc = "经销商ID")
    private Long dealerId;

    /**
     * 省份ID(当前登陆人国内经销商省份ID)
     */
    @XColumn(name = "province_id", desc = "省份ID")
    private Long provinceId;

    /**
     * 状态 1:新增;2:已提交
     */
    @XColumn(name = "status", desc = "状态")
    private String status;

    /**
     * 备注
     */
    @XColumn(name = "remark", desc = "备注")
    private String remark;

    /**
     * 库存数量
     */
    @XColumn(name = "st_num", desc = "库存数量")
    private Integer stNum;

    /**
     * 国内经销商
     */
    private Dealer refDealer;

    /**
     * 省份关联对象
     */
    private Province province;

}
